package com.example.exception;

/**
 * 描述:运行期异常基类
 * 作者:LevelCoder
 * 邮箱:LevelCoder@126.com
 * 版本:V1.0.0
 * 时间:2018/7/25
 */
public abstract  class BaseCheckedException extends Exception implements BaseException {

    /** 异常信息 */
    protected String responseMessage;

    /** 异常码*/
    protected String responseCode;

    public BaseCheckedException(String responseCode, String responseMessage) {
        super(responseMessage);
        this.responseCode = responseCode;
        this.responseMessage = responseMessage;
    }

    public BaseCheckedException(String responseCode, String format, Object... args) {
        super(String.format(format, args));
        this.responseCode = responseCode;
        this.responseMessage = String.format(format, args);
    }

    @Override
    public String getResponseMessage() {
        return responseMessage;
    }

    public void setResponseMessage(String responseMessage) {
        this.responseMessage = responseMessage;
    }

    @Override
    public String getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }
}
